let s = "0P"
var isPalindrome = function(s) {
    let a = s.toLowerCase()
    let arr = []
    for(let i=0;i<a.length;i++){
        if((a[i]>='a'&&a[i]<='z')||(a[i]>='0')&&a[i]<='9'){
            arr.push(a[i])
        }
    }
    for(let i=0;i<Math.floor(arr.length/2);i++){
        if(arr[i]!==arr[arr.length-1-i]){
            return false
        }
    }
    return true
};
console.log(isPalindrome(s));
